import 'package:flutter_axrjc/datasource/network/api/KnowledgeApi.dart';
import 'package:flutter_axrjc/datasource/network/bean/ArticleBean.dart';
import 'package:get/get.dart';

import 'state.dart';

class KnowledgeDetailLogic extends GetxController {
  final KnowledgeDetailState state = KnowledgeDetailState();
  late ArticleBean bean;
  @override
  void onInit() {
    super.onInit();
    bean = Get.arguments as ArticleBean;
    getSingle();
  }

  Future<void> getSingle() async {
    state.data.value =
        await KnowledgeApi.getSingleArticle(key: "${bean.articleId}");
  }
}
